<extend name="Base:base" />
<block name="main-content">
<link href="__PUBLIC__/css/store-user.css" rel="stylesheet">
<link href="__PUBLIC__/css/store-cart.css" rel="stylesheet">
<div id="ListBox" class="box1200">
	<div class="path15">
		<a href="__APP__/Home/Food">首页</a>&nbsp;&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;<a
			href="__APP__/Home/User">个人中心</a>&nbsp;&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;<a
			href="#">订单列表</a>&nbsp;&nbsp;&nbsp;>
	</div>


	<div class="ListBox" style="height: auto; background-color: #fbfbfb;">
		<div class="zlxgBox-left">
			<div class="zlxgBox-left-bt"></div>
			<ul>
				<li><a href="__APP__/Home/User">个人资料</a></li>
				<li><a href="__APP__/Home/User/address">收货地址</a></li>
				<li class="chosen"><a href="#">订单列表</a></li>
				<li><a href="__APP__/Home/User/pwd">修改密码</a></li>
			</ul>
		</div>
		<div class="zlxgBox-right" style="background-color: white;">
			<div class="zlxgBox-right-bt"></div>
			<div class="clear"></div>
			<div class="gwcBox-dd-bt1" style="margin-top: 20px;">
				<dd style="float: left;">
					<div class="moves">
						全部订单<span class="dd-bt1-r" id="food_num">{$count}</span>
					</div>
				</dd>
			</div>
			<div class="clear"></div>
			<div class="gwcBox-dd-bt2 row"
				style="padding: 20px; margin-left: 20px; margin-right: 20px;">
				<label class="col-xs-4">商品</label> <label class="col-xs-2">单价（元）</label>
				<label class="col-xs-1">数量</label> <label class="col-xs-1">金额</label>
				<label class="col-xs-2">状态</label> <label class="col-xs-2">操作</label>
			</div>
			<div class="clear"></div>
			<foreach name="list" item="v">
			<div class="panel panel-success"
				style="margin-left: 20px; margin-right: 20px;">
				<div class="panel-heading">
					<span class="text">日期:{$v.cdate}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单号：{$v.id}</span>
					<span class="glyphicon glyphicon-chevron-down"
						style="float: right;" onclick="javascript:toggle('{$v.id}');"
						id="btn_chevron_{$v.id}"></span>
				</div>
				<div class="panel-body">
					<table class="table">
						<tbody>
					<?php $i=0;foreach ($v['detail'] as $od){ $i++;$count = count($od);?>
						<tr
								<?php if($i!=1){ echo "style='display: none;' class='tr_".$v['id']."' ";} ?>
								onclick="javascript:toggle('{$v.id}');">
								<td class="col-xs-4" style="vertical-align: middle;"><img
									alt="{$od.food_name}" src="{$od.food_image}"
									style="width: 220px; height: 164px;"> {$od.food_name}</td>
								<td class="col-xs-2" style="vertical-align: middle;">{$od.price}元/{$od.unit}</td>
								<td class="col-xs-1" style="vertical-align: middle;">{$od.num}</td>
								<td class="col-xs-1" style="vertical-align: middle;"><strong
									class="text-danger">{$od['price'] * $od['num']}</strong>元</td>
								<td class="col-xs-2"
									style="vertical-align: middle; border-right: 1px #DDDDDD solid;">
									<switch name="v.status"> <case value="0">未配送</case> <case
										value="1">配送中</case> <case value="2">已配送</case> <case
										value="3">已收款</case> </switch>
								</td>
						  	<?php if($i==1){?>
						  		<td class="col-xs-2"
									style="text-align: center; vertical-align: middle;"
									rowspan="{$count}">
									<ul>
										<li><a href="#">再来一单</a></li>
									</ul>
								</td>
						  	<?php }?>
						</tr>
					<?php }?>
					</tbody>
						<tfoot>
							<tr>
								<td colspan="6"></td>
							</tr>
						</tfoot>
					</table>
				</div>
				<div class="panel-footer">
					<strong style="color: red;">总价:{$v.food_price}元</strong>
				</div>
			</div>
			</foreach>
			<div class="neilist_bottom_right">
				<if condition="$totalPages gt 1 ">
				<ul>{$page}
				</ul>
				<form action="__APP__/Home/User/order" method="get">
					<div class="input-group col-xs-2">
						<input type="number" name="p" class="form-control input" placeholder="跳转到" min="1"> <span
							class="input-group-btn">
							<button class="btn btn-default"
								style="background: #efefef none repeat scroll 0 0;"
								type="submit">Go!</button>
						</span>
					</div>
				</form>
				</if>
			</div>
		</div>
	</div>
</div>
<!-- end row --> </block>
<block name="js-content"> <script type="text/javascript">
function toggle(id){
	if($(".tr_"+id).is(":hidden")){
        $("#btn_chevron_"+id).removeClass('glyphicon-chevron-down'); 
        $("#btn_chevron_"+id).addClass('glyphicon-chevron-up'); 
	}else{
		$("#btn_chevron_"+id).removeClass('glyphicon-chevron-up'); 
        $("#btn_chevron_"+id).addClass('glyphicon-chevron-down'); 
	}
	 $(".tr_"+id).toggle();
}
 </script> </block>